﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using KetBanBonPhuong;

public partial class UserControls_Active : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        String EmailAddress = Request.QueryString["Email"];
        if(!String.IsNullOrEmpty(EmailAddress))
        {
            int UserID = User.GetUserbyEmail(EmailAddress);
            if(UserID != -1)
            {
                User user = User.GetInfo(UserID);
                if (user.Active != 3)
                {
                    user.Active = 1;
                    User.Update(user);
                    Panel1.Visible = true;
                    return;
                }
            }
        }
        Panel1.Visible = false;
    }
}
